package com.task.common.entity.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;

/**
 * 操作日志
 * @author Huzz
 * @since 2021-12-08
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("sys_operator_log")
@ApiModel(value="OperatorLog对象", description="")
public class OperatorLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID", example = "123")
    @TableId(type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "操作模块")
    private String title;

    @ApiModelProperty(value = "业务类型")
    private String businessType;

    @ApiModelProperty(value = "请求方法")
    private String method;

    @ApiModelProperty(value = "请求方式")
    private String requestMethod;

    @ApiModelProperty(value = "操作类型(0PC端, 1移动端, 2未知)", example = "123")
    private Integer operatorType;

    @ApiModelProperty(value = "操作人id", example = "123")
    private Integer operatorUserId;

    @ApiModelProperty(value = "操作人姓名")
    private String operatorUserUsername;

    @ApiModelProperty(value = "请求地址")
    private String requestUrl;

    @ApiModelProperty(value = "请求IP")
    private String requestIp;

    @ApiModelProperty(value = "请求位置")
    private String requestLocation;

    @ApiModelProperty(value = "请求参数")
    private String requestParam;

    @ApiModelProperty(value = "返回参数")
    private String responseParam;

    @ApiModelProperty(value = "状态(0正常, 1错误)", example = "123")
    private Integer status;

    @ApiModelProperty(value = "错误信息")
    private String errorMessage;

    @ApiModelProperty(value = "操作时间")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date operatorTime;


}
